Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bm vy mark as purchased #25

Merged
merged 16 commits into from
Mar 2, 2024
Merged

Bm vy mark as purchased #25

merged 16 commits into from
Mar 2, 2024

Conversation

borjaMarti
Copy link
Collaborator

Description

Allow users to mark items as purchased, updating dateLastPurchased and totalPurchases on the Firestore and checking off the item for 24h.

Related Issue

closes #9

Acceptance Criteria

  • The ListItem component renders a checkbox with a semantic .
  • Checking off the item in the UI also updates the dateLastPurchased and totalPurchases properties on the corresponding Firestore document
  • The item is shown as checked for 24 hours after the purchase is made (i.e. we assume the user does not need to buy the item again for at least 1 day). After 24 hours, the item unchecks itself so the user can buy it again.
  • The updateItem function in firebase.js has been filled out, and sends updates to the firestore database when an item is checked

Type of Changes

Type
✨ New feature

Updates

Before

image

After

image

Testing Steps / QA Criteria

  • git pull origin bm-vy-mark-as-purchased
  • Navigate to /manage-list and add some items to any list using the form if you haven't already.
  • Navigate to /list and mark some items as purchased.
  • Open the Firebase console, check that dateLastPurchased and totalPurchases are updated, and change dateLastPurchased of one or more items marked as purchased.
  • Navigate to /list and observe the changes in the UI.

TODO

A functionality that could be added further down the line is the possibility of reverting the purchased state of an item in case of user error.

Copy link

github-actions bot commented Feb 29, 2024

Visit the preview URL for this PR (updated for commit 1fb2839):

https://tcl-71-smart-shopping-list--pr25-bm-vy-mark-as-purcha-dsxq84om.web.app

(expires Sat, 09 Mar 2024 18:58:35 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1e7ade9d0f374c4ddb5d7ab6fc541062fc7a1ab4

Copy link
Collaborator

@BikeMouse BikeMouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

Copy link
Collaborator

@ocsiddisco ocsiddisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done team! I tested with changing the purchase date in firebase and it works perfectly!

@borjaMarti borjaMarti requested a review from Amaka202 March 1, 2024 08:24
Copy link
Collaborator

@Amaka202 Amaka202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work team! your feature works seamlessly!🤯💥💥

@borjaMarti borjaMarti merged commit 1d6deca into main Mar 2, 2024
2 checks passed
@vivitt vivitt deleted the bm-vy-mark-as-purchased branch March 7, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants